Skip to content

update docs on gateawy, session keys & testnet#101

Merged
zkokelj merged 4 commits intomainfrom
ziga/docs_gw_sessionKeys_testnet
Feb 13, 2026
Merged

update docs on gateawy, session keys & testnet#101
zkokelj merged 4 commits intomainfrom
ziga/docs_gw_sessionKeys_testnet

Conversation

@zkokelj
Copy link
Collaborator

@zkokelj zkokelj commented Feb 12, 2026

No description provided.

Copy link
Collaborator

@badgersrus badgersrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better, nice one @zkokelj! Couple of minor tweaks to improve readability

```

## Example implementation
The gateway validates that the session key belongs to the user identified by `encryptionToken`, signs the transaction with the session key’s private key, and propagates it to the TEN node.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence made it a little difficult to read. Could be something like:

The gateway first confirms that the session key belongs to the user identified by encryptionToken. It then signs the transaction with the session key’s private key and sends it to the TEN node.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

// This would be a normal transaction signed by the user's wallet
// transferring ETH to the session key address
}
This path is used in integration tests and may be preferred when your client already expects standard `eth_sendTransaction` semantics. The exact UX and error handling (e.g. non‑session‑key `from`) should follow the gateway implementation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add a link to the gateway implementation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided that is it better to explain it more here in docs and not link to the source code as it is not that easy to read for someone who just wants to use session keys.

# Testnet

TEN Sepolia is our testnet that replicates the capabilities of the TEN Mainnet network. Linked to the Sepolia testnet, you can authenticate with the testnet TEN gateway, use the TEN faucet, and develop and deploy dApps for testing.
TEN Sepolia is our testnet that replicates the capabilities of the TEN Mainnet network. Linked to the Sepolia testnet, you can authenticate with the testnet TEN gateway, use the TEN faucet, and develop and deploy dApps for testing.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I wrote this paragraph originally (lol) but might be better worded:

TEN Sepolia is our testnet environment that mirrors the capabilities of the TEN Mainnet. In this environment, you can authenticate with the TEN testnet gateway, use the TEN faucet, and develop and deploy dApps for testing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced, both versions sound good, but the new one is clearer.

Visit the TEN testnet gateway [here](https://testnet.ten.xyz/). Follow the on‑screen instructions to authenticate with the hosted gateway that allows you to interact with the testnet.

## TEN Sepolia Faucet
## Getting funds to the testnet
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*Getting funds on the testnet?

3. Choose how much Sepolia ETH you want to bridge from L1 to L2 (TEN).
4. Confirm the transaction in your wallet and wait for it to finalize.

## TEN Scan
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TENscan*

**Endpoint:** `POST /v1/join/`

Generates and returns an EncryptionToken.
Creates a new gateway user, generates a fresh viewing key pair, and returns the corresponding **encryption token** (also called “gateway token”) as a hex string. This token is used with both HTTP endpoints and JSON‑RPC.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*This is used with HTTP and JSON-RPC endpoints

**Endpoint:** `POST /v1/getmessage/`

Generates and returns a message (if needed 712 typed message too) for the user to sign based on the provided encryption token.
Generates and returns an authentication message for the user to sign based on the provided encryption token. The gateway can return either an EIP‑712 typed message or a `personal_sign` message.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When does it return EIP-712 vs personal_sign? I guess from a users perspective I'd be wondering what the difference is and if its deterministic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explained

"token": "<hex user token>"
}
```
- Validates the token, checks that the user exists, and sets a long‑lived `HttpOnly`, `Secure` cookie for use by browser dApps.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this just the PR review view of this but appears to be some weird formatting?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

@badgersrus badgersrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@zkokelj zkokelj merged commit d9300de into main Feb 13, 2026
1 check passed
@zkokelj zkokelj deleted the ziga/docs_gw_sessionKeys_testnet branch February 13, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants